package com.liming.common.util;

import java.math.BigDecimal;

/**
 * @author liming
 * @date 2025/1/18
 */
public class BigDecimalUtils {

    public static Integer right1Int(BigDecimal price){
        if (price == null) {
            return null;
        }
        BigDecimal ten = new BigDecimal("10");
        BigDecimal cents = price.multiply(ten);
        return cents.intValueExact();
    }

    public static Integer right2Int(BigDecimal price){
        if (price == null) {
            return null;
        }
        BigDecimal hundred = new BigDecimal("100");
        BigDecimal cents = price.multiply(hundred);
        return cents.intValueExact();
    }
}
